home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: newsfeed.ed.ac.uk!hwcee!ceeab1
- From: ceeab1@cee.hw.ac.uk (Alistair Biggin)
- Subject: HELP WITH INHERITANCE NEEDED
- Message-ID: <DpMEDH.HL@cee.hw.ac.uk>
- Sender: news@cee.hw.ac.uk (News Administrator)
- Organization: Dept of Computing and Electrical Engineering, Heriot-Watt University
- X-Newsreader: TIN [version 1.2 PL2]
- Date: Wed, 10 Apr 1996 00:22:28 GMT
-
- I have a class heirachy that looks like this
-
- classA< type >
- {
- public :
- otherClass* pointer ;
-
- classA()
- {
- pointer = new otherClass ;
- }
- }
-
- classB< type >
- {
- public :
- classB():classA< type >()
- }
-
- classC< type >
- {
- public :
- classC():classB< type >()
- }
-
- When I create an object of classC, the pinter gets set in the constructor of
- classA, but when a method from classB is called, the pointer is NULL and the
- method fails....
-
- Why ?
-
- --------------------------------------------------------------------------
-
- Alistair Biggin A.Biggin@hw.ac.uk
- BEng Information Systems Engineering (3rd Year)
- Heriot-Watt University, Edinburgh, Scotland WWWWW
- |O O|
- -------------------------------------------------------------oOO--0--OOo--
-